<?php
$authenticated = false;
$password = 'schalke05';
$cookie_name = 'auth';
error_reporting(E_ALL);
ini_set("display_errors", 1);
include "simple_html_dom.php";
include("getData.php");
$cookie_time = (3600 * 24 * 30); // 30 days

if(isSet($_POST['submit']))
{
	$post_password = trim($_POST['password']);
	if ( $post_password == $password)
	{
		$authenticated = true;
		$password_hash = md5($password);
		setcookie ($cookie_name, $password_hash, time() + $cookie_time);
	}
}

$wetterSource = file_get_contents('http://data.wetter.info/wetterapp/wetterAppController.php?mapName=xxlradar-de&layers=radar&enableStandalone=iframe&enableHighlighting=false&enableCityClick=false&enableSelector=false&autoplay=true&enableShowTimestamp=true');

preg_match_all("([0-9]{12}\.gif)", $wetterSource, $treffer, PREG_SET_ORDER);

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>M&uuml;nster-Wetter</title>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
		<script type="text/javascript" src="imageloader.js"></script>
		<script type="text/javascript" src="gauge.js"></script>
		<script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js"></script>
        <link rel="apple-touch-icon" href="/wetter/mswetter.png" />

		<link rel="stylesheet" href="images/Envision.css" type="text/css" />
		<link href="http://www.krystof.eu/wetter/favicon.ico" rel="icon" type="image/x-icon" />


<script type="text/javascript">
	if ((navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPod') != -1) || (navigator.userAgent.indexOf('Android') != -1)) {
		document.location = "http://www.krystof.eu/m";
	}
</script>


   <script type='text/javascript' src='https://www.google.com/jsapi'></script>

		
		<script type="text/javascript" language="JavaScript">

<!--

var offsetx=20

var offsety=0



function InfoBoxAusblenden() {

      document.getElementById('infobox').style.visibility = "hidden";

}



function InfoBoxAnzeigen(e,offsetX,offsetY)

{

        if (offsetX) {offsetx=offsetX;} else {offsetx=20;}

        if (offsetY) {offsety=offsetY;} else {offsety=0;}

        var PositionX = 0;

        var PositionY = 0;

        if (!e) var e = window.event;

        if (e.pageX || e.pageY)

        {

                PositionX = e.pageX;

                PositionY = e.pageY;

        }

        else if (e.clientX || e.clientY)

        {

                PositionX = e.clientX + document.body.scrollLeft;

                PositionY = e.clientY + document.body.scrollTop;

        }

        document.getElementById('infobox').style.left = (PositionX+offsetx)+"px";

        document.getElementById('infobox').style.top = (PositionY+offsety)+"px";

        document.getElementById('infobox').style.visibility = "visible";

}
function InfoBox2Ausblenden() {

      document.getElementById('infobox2').style.visibility = "hidden";

}



function InfoBox2Anzeigen(e,offsetX,offsetY)

{

        if (offsetX) {offsetx=offsetX;} else {offsetx=20;}

        if (offsetY) {offsety=offsetY;} else {offsety=0;}

        var PositionX = 0;

        var PositionY = 0;

        if (!e) var e = window.event;

        if (e.pageX || e.pageY)

        {

                PositionX = e.pageX;

                PositionY = e.pageY;

        }

        else if (e.clientX || e.clientY)

        {

                PositionX = e.clientX + document.body.scrollLeft;

                PositionY = e.clientY + document.body.scrollTop;

        }

        document.getElementById('infobox2').style.left = (PositionX+offsetx)+"px";

        document.getElementById('infobox2').style.top = (PositionY+offsety)+"px";

        document.getElementById('infobox2').style.visibility = "visible";

}

// -->



</script>



		
		
		<script type="text/javascript">

			var _gaq = _gaq || [];
			_gaq.push(['_setAccount', 'UA-1951840-2']);
			_gaq.push(['_trackPageview']);

			(function() {
				var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
				ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
				var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
			})();

		</script>
	</head>
	<body>
<!-- Anfang DIV-Layer --> <div id="infobox" style="text-align:left;word-wrap: break-word; font-size: 10px;position:absolute;top:25px;z-index:5;visibility:hidden;width:300px;"> <p  style="border: 1px solid #0090E0; background-color: #F9FCFF;   color: #5F5F5F; padding: 10px;">

<span id="text">Die Äquivalenttemperatur ist die Temperatur der Luft, die erreicht wird, wenn der gesamte in ihr enthaltene Wasserdampf kondensiert und die dabei freiwerdende Wärmeenergie zur Erhöhung der Lufttemperatur verwendet wird. Sie stellt ein Maß für die Wärmebelastung des menschlichen Körpers dar. Eine Äquivalenttemperatur von mehr als 49 Grad wird vom menschlichen Körper als belastend empfunden. Sportliche Aktivitäten sollten in diesem Fall vermieden werden.</span></p> </div> <!-- Ende DIV-Layer -->

<!-- Anfang DIV-Layer --> <div id="infobox2" style="text-align:left;word-wrap: break-word; font-size: 10px;position:absolute;top:25px;z-index:5;visibility:hidden;width:300px;"> <p  style="border: 1px solid #0090E0; background-color: #F9FCFF;   color: #5F5F5F; padding: 10px;">

<span id="text2">Die Daten der Uni M&uuml;nster sind veraltet. Verarbeite alternative Messdaten aus Burksteinfurt. </span></p> </div> <!-- Ende DIV-Layer -->
	
		<div id="wrap">
			<div id="header">
				<h1 id="logo-text">M&uuml;nster-Wetter</h1>

			</div>
			<div  id="menu">
				<ul>
					<li id="current"><a href="index.php?id=1">Home</a></li>
					<?php //<li class="last"><a href="index.php?id=2">Regenradar</a></li>?>
				</ul>
			</div>
			<div id="content-wrap">

				<?php


//				if($authenticated || (isSet($_COOKIE[$cookie_name]) && $_COOKIE[$cookie_name] == md5($password)))
//				{
					printMain();
//				}
//				elseif(!isSet($_COOKIE[$cookie_name]))
//				{
//					printLogin();
//				}
//				else
//				{
//					printLogin();
//				}



				?>



			</div>
			<div id="footer">
				<?
				// record script end time
				$endtime = microtime();

				// combine seconds and microseconds for start and end times
				$stime = explode(' ', $starttime);
				$start = $stime[0] + $stime[1];

				$etime = explode(' ', $endtime);
				$end = $etime[0] + $etime[1];


				// spit out run time, formated to 4 decimal places


				?>
				<p> &copy; 2009 <strong>krystof.eu</strong> | Design by: <a href="http://www.styleshout.com/">styleshout</a> | Valid <a href="http://validator.w3.org/check?uri=referer">XHTML</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>   | Renderzeit: <?php echo number_format($end - $start, 3);?> |

					<?
					$filename = 'getData.php';
					if (file_exists($filename)) {
						echo "Letztes Update: " . date ("d/M/y H:i", filemtime($filename));
					}
					?>
				</p>
			</div>
		</div>
	</body>
</html>
